package com.rnd.kx.mvp.model;

import com.rnd.kx.mvp.bean.IndexBean;
import com.rnd.kx.mvp.bean.LoginBean;
import com.rnd.kx.mvp.bean.SearchBean;
import com.rnd.kx.mvp.contract.MainContract;
import com.rnd.kx.mvp.http.bean.BaseObjectBean;
import com.rnd.kx.mvp.http.net.RetrofitClient;

import io.reactivex.Flowable;

public class MainModel implements MainContract.Model {
    @Override
    public Flowable<BaseObjectBean<LoginBean>> login(String username, String password) {
        return RetrofitClient.getInstance().API().login(username,password);
    }

    @Override
    public Flowable<BaseObjectBean<SearchBean>> getSearch(String keywords) {
        return RetrofitClient.getInstance().API().getSearch(keywords);
    }

    @Override
    public Flowable<BaseObjectBean<IndexBean>> getIndex() {
        return RetrofitClient.getInstance().API().getIndex();
    }
}
